namespace GameSchoolApplication.Migrations
{
    using System.Data.Entity.Migrations;
    
    public partial class AddForeignKeysToGameGameInstructor : DbMigration
    {
        public override void Up()
        {
            AddForeignKey("Games", "AuthorId", "People", "Id", cascadeDelete: false);
            AddForeignKey("GameInstructors", "TeacherId", "People", "Id", cascadeDelete: false);
            AddForeignKey("GameInstructors", "GameId", "Games", "GameId", cascadeDelete: false);
            AddForeignKey("StudentPoints", "StudentId", "People", "Id", cascadeDelete: false);
            AddForeignKey("StudentPoints", "GameId", "Games", "GameId", cascadeDelete: false);
            CreateIndex("Games", "AuthorId");
            CreateIndex("GameInstructors", "TeacherId");
            CreateIndex("GameInstructors", "GameId");
            CreateIndex("StudentPoints", "StudentId");
            CreateIndex("StudentPoints", "GameId");
        }
        
        public override void Down()
        {
            DropIndex("StudentPoints", new[] { "GameId" });
            DropIndex("StudentPoints", new[] { "StudentId" });
            DropIndex("GameInstructors", new[] { "GameId" });
            DropIndex("GameInstructors", new[] { "TeacherId" });
            DropIndex("Games", new[] { "AuthorId" });
            DropForeignKey("StudentPoints", "GameId", "Games");
            DropForeignKey("StudentPoints", "StudentId", "People");
            DropForeignKey("GameInstructors", "GameId", "Games");
            DropForeignKey("GameInstructors", "TeacherId", "People");
            DropForeignKey("Games", "AuthorId", "People");
        }
    }
}
